require 'socket'

# //创建一个socket
socket = Socket.new(:INET,:STREAM)

# 实例化绑定的地址信息
addr = Socket.pack_sockaddr_in(4481,"0.0.0.0")

# 设置绑定
socket.bind addr